\(\int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx\) [170]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 55 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {2 x}{a^2}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}-\frac {\tan (c+d x)}{a^2 d} \]

[Out]

2*x/a^2+2*I*ln(sin(d*x+c))/a^2/d-2*I*ln(tan(d*x+c))/a^2/d-tan(d*x+c)/a^2/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3167, 862, 78} \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\tan (c+d x)}{a^2 d}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}+\frac {2 x}{a^2} \]

[In]

Int[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^2,x]

[Out]

(2*x)/a^2 + ((2*I)*Log[Sin[c + d*x]])/(a^2*d) - ((2*I)*Log[Tan[c + d*x]])/(a^2*d) - Tan[c + d*x]/(a^2*d)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3167

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[-d^(-1), Subst[Int[x^m*((b + a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1+x^2}{x^2 (i a+a x)^2} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {-\frac {i}{a}+\frac {x}{a}}{x^2 (i a+a x)} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (-\frac {1}{a^2 x^2}-\frac {2 i}{a^2 x}+\frac {2 i}{a^2 (i+x)}\right ) \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {2 x}{a^2}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}-\frac {\tan (c+d x)}{a^2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.65 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=-\frac {\frac {2 i \log (i-\tan (c+d x))}{d}+\frac {\tan (c+d x)}{d}}{a^2} \]

[In]

Integrate[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^2,x]

[Out]

-((((2*I)*Log[I - Tan[c + d*x]])/d + Tan[c + d*x]/d)/a^2)

Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.55

method result size
derivativedivides \(\frac {-\tan \left (d x +c \right )-2 i \ln \left (\tan \left (d x +c \right )-i\right )}{d \,a^{2}}\) \(30\)
default \(\frac {-\tan \left (d x +c \right )-2 i \ln \left (\tan \left (d x +c \right )-i\right )}{d \,a^{2}}\) \(30\)
risch \(\frac {4 x}{a^{2}}+\frac {4 c}{a^{2} d}-\frac {2 i}{a^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{a^{2} d}\) \(60\)
norman \(\frac {-\frac {2 x}{a}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {2 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 i \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2} d}+\frac {2 i \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2} d}-\frac {2 i \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{a^{2} d}\) \(138\)

[In]

int(sec(d*x+c)^2/(cos(d*x+c)*a+I*a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d/a^2*(-tan(d*x+c)-2*I*ln(tan(d*x+c)-I))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.27 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {2 \, {\left (2 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + 2 \, d x - {\left (-i \, e^{\left (2 i \, d x + 2 i \, c\right )} - i\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i\right )}}{a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d} \]

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

2*(2*d*x*e^(2*I*d*x + 2*I*c) + 2*d*x - (-I*e^(2*I*d*x + 2*I*c) - I)*log(e^(2*I*d*x + 2*I*c) + 1) - I)/(a^2*d*e
^(2*I*d*x + 2*I*c) + a^2*d)

Sympy [F]

\[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {\int \frac {\sec ^{2}{\left (c + d x \right )}}{- \sin ^{2}{\left (c + d x \right )} + 2 i \sin {\left (c + d x \right )} \cos {\left (c + d x \right )} + \cos ^{2}{\left (c + d x \right )}}\, dx}{a^{2}} \]

[In]

integrate(sec(d*x+c)**2/(a*cos(d*x+c)+I*a*sin(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)**2/(-sin(c + d*x)**2 + 2*I*sin(c + d*x)*cos(c + d*x) + cos(c + d*x)**2), x)/a**2

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.55 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {-\frac {2 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac {\tan \left (d x + c\right )}{a^{2}}}{d} \]

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

(-2*I*log(tan(d*x + c) - I)/a^2 - tan(d*x + c)/a^2)/d

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.82 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {2 \, {\left (\frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}{a^{2}} + \frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} + \frac {-i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}}\right )}}{d} \]

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

2*(I*log(tan(1/2*d*x + 1/2*c) + 1)/a^2 - 2*I*log(tan(1/2*d*x + 1/2*c) - I)/a^2 + I*log(tan(1/2*d*x + 1/2*c) -
1)/a^2 + (-I*tan(1/2*d*x + 1/2*c)^2 + tan(1/2*d*x + 1/2*c) + I)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a^2))/d

Mupad [B] (verification not implemented)

Time = 22.70 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.51 \[ \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx=\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^2\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,4{}\mathrm {i}}{a^2\,d}+\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,2{}\mathrm {i}}{a^2\,d} \]

[In]

int(1/(cos(c + d*x)^2*(a*cos(c + d*x) + a*sin(c + d*x)*1i)^2),x)

[Out]

(2*tan(c/2 + (d*x)/2))/(d*(a^2*tan(c/2 + (d*x)/2)^2 - a^2)) - (log(tan(c/2 + (d*x)/2) - 1i)*4i)/(a^2*d) + (log
(tan(c/2 + (d*x)/2)^2 - 1)*2i)/(a^2*d)